label: don't use set_text in gtk_label_new
authorTimm Bäder <mail@baedert.org>
Tue, 3 May 2016 23:26:02 +0000 (19:26 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 3 May 2016 23:26:43 +0000 (19:26 -0400)
It would just set up lots of things with the default values, but a
common case is that a few gtk_label_set_* calls follow.

gtk/gtklabel.c

index 5607c91495c04030ea7ebf2b1fc78074fd55b72f..c3d5db7fd8b0a0effb706665bedb9d6f59fe6a4f 100644 (file)
@@ -1365,7 +1365,7 @@ gtk_label_init (GtkLabel *label)
 
   priv->width_chars = -1;
   priv->max_width_chars = -1;
-  priv->label = NULL;
+  priv->label = g_strdup ("");
   priv->lines = -1;
 
   priv->xalign = 0.5;
@@ -1391,8 +1391,6 @@ gtk_label_init (GtkLabel *label)
 
   priv->mnemonics_visible = TRUE;
 
-  gtk_label_set_text (label, "");
-
   priv->gadget = gtk_css_custom_gadget_new_for_node (gtk_widget_get_css_node (GTK_WIDGET (label)),
                                                      GTK_WIDGET (label),
                                                      gtk_label_measure,